package com.nova.edc.service.system;

import com.nova.edc.model.system.AreaPoint;
import com.nova.edc.model.system.CollectArea;
import com.nova.edc.model.system.CustomerArea;
import com.nova.edc.model.system.CustomerInfo;
import com.nova.edc.model.util.ExcelArea;
import com.nova.frame.dao.pager.Page;
import com.nova.frame.dao.pager.PageList;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Map;

public interface AreaPointService {

    AreaPoint insert(AreaPoint areapoint);

    AreaPoint checkInsert(AreaPoint areaPoint);

    int delete(AreaPoint areapoint);

    int update(AreaPoint areapoint);

    PageList<AreaPoint> findAreaPointPageList(AreaPoint areapoint, Page page, String sidx, String sord);

    AreaPoint findById(int id);

    // 根据网关、通道、设备号获取节点信息
    AreaPoint getByDetail(String gatewayid, Integer sensorid, Integer channelid);

    List<AreaPoint> findByExample(AreaPoint areaPoint);

    // 根据excel导入数据
    void insertByExcel(List<ExcelArea> list);

    //改变节点总功率
    void updatePower(Integer type, Integer pointid, Integer num, Integer devicetid);

    //获取所有网关
    List<String> getAllGateway();

    //获取网关及所属公司
    List<Map<String, Object>> getAllGatewayCustomer();

    //获取公司所有网关
    List<String> getCustomerGateway(Integer id);

    //根据areapoint信息获取到companycode
    Integer getCompanyCode(AreaPoint areaPoint);

    //根据区域获取该区域内不同设备类型的个数
    List<Map<String, Object>> findDeviceDetail(Integer areaId);

    //判断节点是否存在
    boolean existAreaPoint(AreaPoint areaPoint);

    //判断节点是否工作
    List<AreaPoint> findPageAreaPointStatus(AreaPoint areaPoint, int companycode,
                                            String summaryDate, Page page, String sidx, String sord);

    List<AreaPoint> findAll();

    //获取节点实时工作状况
    void findStatu(AreaPoint point);

    //获得一段时间内节点工作时间
    void findActivetime(String startday, String endday, List<AreaPoint> areaPointList, Integer state);

    //获取节点所属网关
    List<String> getGateway(List<AreaPoint> areaPoints);

    List<AreaPoint> getByCompany(CustomerInfo customerInfo);

    List<AreaPoint> getByCompany(List<CustomerInfo> customerInfoList);

    //获取节点总用电量
    double getEnergy(List<AreaPoint> areaPoints);

    //根据公司及区域获得节点
    AreaPoint getByarea(String areaName, Integer customerinfoId);

    void fortrim(AreaPoint areaPoint);

    List<String> getCustomerGateway(List<CustomerInfo> customerInfoList) ;

    List<Map<String, Object>> findPointOnly(Integer customerinfoId);

//获取每个客户所有区域的代表节点或单个区域的
    List<AreaPoint> findAreaMainPoint(Integer customerinfoId, String areaName);
}
